package com.tjhk.java.tech.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class UserProxyHandler implements InvocationHandler {
    private  Object target;

    public UserProxyHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.print("使用代理-->");
        return method.invoke(target,args);
    }
}
